function promiseRace(promiseArr) {
  if(!Array.isArray(promiseArr)) {
    return Promise.reject(new TypeError('参数必须是数组'))
  }
  if(promiseArr.length===0) {
    return new Promise(()=>{}) //永远处于pending状态
  }
  return new Promise((resolve, reject)=> {
    promiseArr.forEach(promise=> {
      Promise.resolve(promise).then(resolve, reject)
    })
  })
}